#include<iostream>
#include<unistd.h>
#include<signal.h>
#include<sys/wait.h>
int main()
{
    pid_t id = fork();
    if(id == 0)
    {
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        printf("hello word\n");
        int a = 10;
        a /= 0;
        exit(1);
    }
    int status = 0;
    waitpid(id,&status,0);
    printf("signal: %d,exit code: %d,core dump:%d\n",(status & 0x7F),(status >> 8) & 0xFF , (status >> 7) & 0x1);
    return 0;
}